<?php
require_once($application_folder."/controllers/navigator.php");
class Comments extends navigator 
{

    function __construct()
    {
        parent::__construct(); 
        $this->load->model('comments_mod');
    } 
    
    function index(){
        $this->getComments();
    }
    
    function getComments(){
        
        $this->load->model('datam');
        
        $res['columns'] = $this->datam->getColumns();
        $res['tickerNews'] = $this->datam->getArticlesColsSubcolsWithDefaultMediaByTags(1, '0,2');
        $res['last'] = $this->datam->getArticlesColsSubcolsWithDefaultMediaByTags(1, 1);
        $res['four_side'] = $this->datam->getArticlesColsSubcolsWithDefaultMediaByTags(1, 5);             
        $res['articles_line'] = $this->datam->getArticlesColsSubcolsWithDefaultMedia();             
        $res['title'] = 'Dobrodosli';         
        $res['gImage'] = $this->initializeGetImage(); 
        
        //$res['articles_today1'] =  $this->datam->getArticlesColsSubcolsWithDefaultMediaByTags(1,'5,6');
        //$res['articles_sevenday'] =  $this->datam->getArticlesColsSubcolsWithDefaultMediaByTags(1,'7,4');
        
        $res['articles_today1'] =  $this->datam->getArticlesPastTime(1,6,1);
        $res['articles_sevenday'] =  $this->datam->getArticlesPastTime(1,4,7);
        
        $res['articles_top_comments'] =  $this->datam->getArticlesTopCommnets(1,6);
        
        $this->core_site('comments', $res, 'comments');
        
    }   
    
    public function insertComment()
    {
    	$post = $this->input->post();
    	$response = $this->comments_mod->insertComment($post);
    	print($response);
    }
    

}